/**       
 * @{#} GenericObjectPoolConfig.java Create on 2012-3-29 下午3:11:48       
 *       
 * Copyright (c) 2012 by able.       
 */
package __javable.core.util.pool.impl;

/**
 * 
 * 
 * @history <PRE>
 * --------------------------------------------------------- 
 * VERSION       DATE            BY       CHANGE/COMMENT 
 * --------------------------------------------------------- 
 * 1.0           2012-3-29      able         create 
 * ---------------------------------------------------------
 * </PRE>
 * 
 */
public class GenericObjectPoolConfig extends BaseObjectPoolConfig {
	/**
	 * The default maximum number of instances under management (idle or checked
	 * out).
	 */
	public static final int DEFAULT_MAX_TOTAL = 8;

	/**
	 * The default cap on the number of "sleeping" instances in the pool.
	 */
	public static final int DEFAULT_MAX_IDLE = 8;

	/**
	 * The default minimum number of "sleeping" instances in the pool before
	 * before the evictor thread (if active) spawns new objects.
	 */
	public static final int DEFAULT_MIN_IDLE = 0;

	private int maxTotal = DEFAULT_MAX_TOTAL;

	private int maxIdle = DEFAULT_MAX_IDLE;

	private int minIdle = DEFAULT_MIN_IDLE;

	public int getMaxTotal() {
		return maxTotal;
	}

	public void setMaxTotal(int maxTotal) {
		this.maxTotal = maxTotal;
	}

	public int getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	public int getMinIdle() {
		return minIdle;
	}

	public void setMinIdle(int minIdle) {
		this.minIdle = minIdle;
	}

	@Override
	public GenericObjectPoolConfig clone() {
		try {
			return (GenericObjectPoolConfig) super.clone();
		} catch (CloneNotSupportedException e) {
			throw new AssertionError(); // Can't happen
		}
	}
}